package com.daqsoft.dto;

import com.daqsoft.data.Module;

import java.util.List;

/**
 * @author 周麟东 on 9:59
 */
public class ExtTreeNode {
    private int id;
    private String text;
    private boolean expanded;
    private boolean disabled;
    private boolean checked;


    private boolean leaf;
    /**
     * 模块名称
     */
    private String moduleName;
    /**
     * 模块地址
     */
    private String viewType;
    /**
     * 父级id
     */
    private Integer pid;
    /**
     * 是否为项目节点
     */
    private boolean projectModule;
    /**
     * 子级叶子节点
     */
    private List<ExtTreeNode> children;
    /**
     * 图标地址
     */
    private String iconCls;

    public ExtTreeNode(Module module) {
        this.text = module.getModuleName();
        this.id = module.getId();
        this.leaf = module.isLeaf();
        this.moduleName = module.getModuleName();
        this.viewType = module.getUrl();
        if (module.getpModule()!=null)
        this.pid = module.getpModule().getId();
        this.projectModule = module.isProjectModule();
        this.iconCls = module.getIcon();
        this.expanded = !module.isLeaf();
    }

    public boolean isExpanded() {
        return expanded;
    }

    public void setExpanded(boolean expanded) {
        this.expanded = expanded;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public boolean isDisabled() {
        return disabled;
    }

    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }

    public boolean isChecked() {
        return checked;
    }

    public void setChecked(boolean checked) {
        this.checked = checked;
    }

    public boolean isLeaf() {
        return leaf;
    }

    public void setLeaf(boolean leaf) {
        this.leaf = leaf;
    }

    public String getModuleName() {
        return moduleName;
    }

    public void setModuleName(String moduleName) {
        this.moduleName = moduleName;
    }

    public String getViewType() {
        return viewType;
    }

    public void setViewType(String viewType) {
        this.viewType = viewType;
    }


    public boolean isProjectModule() {
        return projectModule;
    }

    public void setProjectModule(boolean projectModule) {
        this.projectModule = projectModule;
    }

    public List<ExtTreeNode> getChildren() {
        return children;
    }

    public void setChildren(List<ExtTreeNode> children) {
        this.children = children;
    }

    public String getIconCls() {
        return iconCls;
    }

    public void setIconCls(String iconCls) {
        this.iconCls = iconCls;
    }

    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }
}
